#ifndef _PLAYLIST_H_
#define _PLAYLIST_H_

#ifndef TRUE
#	define FALSE 0
#	define TRUE !FALSE
#endif

#ifndef NULL
#	define NULL (void*)0
#endif



typedef struct _playlist_fl {
	struct _playlist *first;
	struct _playlist *last;
	int count;
	int shuffle;
} playlist_fl;

typedef struct _playlist {
	struct _playlist *_previous;
	struct _playlist *_next;
	playlist_fl * fl;
	int shuf;
	char* filename;
	char* track;
	char* title;
	char* artist;
	char* album;
	struct _playlist* (*insert) (struct _playlist*, char*);
	struct _playlist* (*remove) (struct _playlist*);
	struct _playlist* (*index)(struct _playlist*, int);
	struct _playlist* (*first)(struct _playlist*);
	struct _playlist* (*last)(struct _playlist*);
	struct _playlist* (*next)(struct _playlist*);
	struct _playlist* (*previous)(struct _playlist*);
	void (*shuffle) (struct _playlist*);
	
} playlist;

playlist* _index(playlist* this, int id);
playlist* _next(playlist* this);
playlist* _previos(playlist* this);
playlist* _insert(playlist* this,char* path);
playlist* _remove(playlist* this);
playlist* _first(playlist* this);
playlist* _last(playlist* this);
void _shuffle(playlist* this);
void _reshufle(playlist* this);
void dump_pl(playlist* pl);

void populate_methods(playlist* this);
playlist* create_playlist(); ///constructor method
playlist* playlist_argv(int argc, char* argv[]);



#endif
